/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ep.m002.module;

import com.vaadin.ui.ComponentContainer;
import ep.libs.implementations.AbstractApplication;
import ep.libs.implementations.AbstractModule;
import ep.m001.ui.views.LoginView;
import ep.m002.ui.views.M002DoctorView;
import ep.m002.ui.views.M002PharmacistView;
import ep.m002.ui.views.M002View;

/**
 *
 * @author skyr
 */
public class M002Module extends AbstractModule {

    public M002Module(AbstractApplication application) {
        super(application);
    }

    public M002Module(AbstractApplication application, Object[] args) {
        super(application, args);
    }

    @Override
    public ComponentContainer getModule() {
        Short type = (Short) args[0];
        M002View m002View;
        if (type.equals(LoginView.DOCTOR_TYPE)) {
            m002View = new M002DoctorView(this, args);
        } else if (type.equals(LoginView.PHARMACIST_TYPE)) {
            m002View = new M002PharmacistView(this, args);
//        } else if (type.equals(LoginView.DEP_TYPE)){
//            M002DepView depView = new M002DepView(this, args);
//            return depView.getView();
        } else {
            m002View = new M002View(this, args);
        }
        return m002View.getView();
    }
}
